package com.feng.yupaoback.enums;

import com.feng.yupaoback.constant.BaseConst;
import lombok.Getter;
import lombok.Setter;

/**
 * 队伍状态枚举
 */
@Getter
public enum TeamStatusEnum {

    PUBLIC(BaseConst.PUBLIC_STATUS, "公开"),
    PRIVATE(BaseConst.PRIVATE_STATUS, "私有"),
    SECRET(BaseConst.SECRET_STATUS, "加密");

    private final int value;

    private final String text;

    public static TeamStatusEnum getTeamStatusValue(Integer value) {
        if (value == null){
            return null;
        }
        TeamStatusEnum[] values = TeamStatusEnum.values();
        for (TeamStatusEnum teamStatusEnum : values) {
            if (teamStatusEnum.getValue() == value) {
                return teamStatusEnum;
            }
        }
        return null;
    }

    TeamStatusEnum(int value, String text) {
        this.text = text;
        this.value = value;
    }

}
